const express = require("express");
const router = express.Router();

const expressJoi = require("@escook/express-joi");
const userSchema = require("../schema/user");

//方式一
// const userHandler = require('../router_handler/user')
// router.post('/reguser',userHandler.regUser)
// router.post('/login',userHandler.login)

//方式二
const { regUser, login } = require("../router_handler/user");
router.post("/reguser", expressJoi(userSchema), regUser);
router.post("/login", expressJoi(userSchema), login);
module.exports = router;
